package testcase.doctor;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.json.JSONException;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.xml.sax.SAXException;


import api.doctor.GetAllCategories;
import common.Host;
import common.TestData;

/**
 * 帮忙医医生端获取所有模板类型接口GetAllCategories测试用例
 * @author gaowen
 *
 */
public class TestGetAllCategories
{
	/**
	 * 帮忙医医生端获取所有科室接口GetAllCategories测试环境数据驱动
	 * @return 测试数据
	 * @throws ParserConfigurationException
	 * @throws SAXException
	 * @throws IOException
	 */
	@DataProvider(name="Test")
	public static String[][] testGetAllCategoriesDataProvider() throws ParserConfigurationException, SAXException, IOException
	{
		Host.setup("Test");
		TestData tData=new TestData("doctor/TestGetAllCategories.xml");
		return tData.getParam();
	}
	
	/**
	 * 帮忙医医生端获取所有科室接口GetAllCategories生产环境数据驱动
	 * @return 测试数据
	 * @throws ParserConfigurationException
	 * @throws SAXException
	 * @throws IOException
	 */
	@DataProvider(name="Prod")
	public static String[][] prodGetAllCategoriesDataProvider() throws ParserConfigurationException, SAXException, IOException
	{
		Host.setup("Prod");
		TestData tData=new TestData("doctor/TestGetAllCategories.xml");
		return tData.getParam();
	}
	
	/**
	 * 帮忙医医生端获取所有科室接口GetAllCategories测试环境测试用例
	 * @param caseName 用例名
	 * @param token 调接口需要的token
	 * @throws JSONException 
	 * @throws IOException 
	 */
	@Test(dataProvider="Test",groups="Test")
	public void testGetAllCategoriesTestCase(String caseName) throws JSONException, IOException
	{
		String result=GetAllCategories.get();
		
		
		switch (caseName)
		{
			case "Success":
				Assert.assertNotNull(result);
				break;
			default:
				break;
		}
	}
	
	/**
	 * 帮忙医医生端获取所有科室接口GetAllCategories生产环境测试用例
	 * @param caseName 用例名
	 * @param token 调接口需要的token
	 * @throws JSONException 
	 * @throws IOException 
	 */
	@Test(dataProvider="Prod",groups="Prod")
	public void prodGetAllCategoriesTestCase(String caseName) throws JSONException, IOException
	{
		String result=GetAllCategories.get();
		
		
		switch (caseName)
		{
			case "Success":
				Assert.assertNotNull(result);
				break;
			default:
				break;
		}
	}
}
